﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Automobile.service.Model;
using Automobile.service.BLL;

namespace Automobile.service.UI
{
    public partial class Employee_Add : System.Web.UI.Page
    {
        EmployeeBLL bll = new EmployeeBLL();
        protected void Page_Load(object sender, EventArgs e)
        {

        }
         protected void Button1_Click(object sender, EventArgs e)
        {
            Employee emp = new Employee();
            emp.Employee_Name = Employee_Name.Value;
            emp.Employee_Pwd = Employee_Pwd.Value;
            emp.Employee_Phone = Employee_Phone.Value;
            emp.Employee_Addr = Employee_Addr.Value;
            emp.Employee_Remark = Employee_Remark.Value;
            if (bll.AddEmployee(emp) > 0)
            {
                JournalBLL jbll = new JournalBLL();
                jbll.AddJourna_AddEmp(Convert.ToInt32(Session["empid"]),emp);
                Response.Write("<script>alert('添加成功！');parent.location.reload(); parent.layer.close(parent.layer.getFrameIndex(window.name));</script>");
            }
            else
            {
                Response.Write("<script>alert('添加失败！'); parent.layer.close(parent.layer.getFrameIndex(window.name));</script>");
            }
        }
    }
}